package com.zzedu.integration.tencentcloudspeech.config;

import com.tencent.core.ws.Credential;
import com.tencent.core.ws.SpeechClient;
import com.tencent.soe.OralEvalConstant;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
@EnableConfigurationProperties(SpeechConfig.class)
public class SpeechInitConfig {

    @Autowired
    private SpeechConfig speechConfig;

    @Bean
    public Credential credential() {
        return new Credential(speechConfig.getAppId(), speechConfig.getSecretId(), speechConfig.getSecretKey());
    }

    @Bean
    public SpeechClient speechClient() {
        return new SpeechClient(OralEvalConstant.DEFAULT_ORAL_EVAL_REQ_URL);
    }
}
